package oopCourse;
import java.lang.Math;
class Circle {
    private double radius;

    public void setRadius(double r) {
        radius = r;
    }

    public double getRadius(){
        return radius;
    }
    public double area(){
        return Math.PI*radius*radius;
    }
    public double perimeter(){
        return 2*Math.PI*radius;
    }
    public static void main(String[] args) {
        Circle cir1=new Circle();
        cir1.setRadius(3);
        System.out.println("周长:"+cir1.perimeter());
        System.out.println("面积:"+cir1.area());
    }
}
